reduce fractions to lowest terms